package com.example.experiment2.service.Impl;

import com.example.experiment2.entity.Course;
import com.example.experiment2.mapper.CourseMapper;
import com.example.experiment2.service.CourseService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {
    @Resource
    private CourseMapper courseMapper;

    @Override
    public List<Course> listAll() {
        return courseMapper.selectList(null);
    }

    @Override
    public Course getById(int courseId) {
        return courseMapper.selectById(courseId);
    }

    @Override
    public void add(Course course) {
        courseMapper.insert(course);
    }
}